package assign4;

/** Launches clients and distributes their connections between active servers.
 */
public class DBClientCreator
{
	static int clientCount = Globals.numOfClients;
	static ReplicatedDBClient[] clients = new ReplicatedDBClient[clientCount];
	
	public static void main(String[] args) throws Exception
	{	
		for(int i=0; i<clientCount; ++i)
		{
			int serverIndex = i % Globals.numOfServers;
			clients[i] = new ReplicatedDBClient("Client" + i, "Server" + serverIndex);
		}
		
		for(ReplicatedDBClient client : clients)
		{
			new Thread(client).start();
		}
	}
}